<template lang="html">
    <div class="asking-order-page normal-table-page">
        <Card :dis-hover="true">
            <p slot="title">
                <Icon type="help"></Icon> 问答订单
            </p>
            <div slot="extra">

                <Input v-model="searchKey" class="search-input" icon="search" placeholder="订单号、订单状态或付款方式" style="width: 300px" @keydown.native.enter="doSearch"></Input>
                <Button type="ghost" class="add-new-btn" v-if="searchKey" @click="clearSearch()">清空</Button>

                <Button type="ghost" class="add-new-btn" icon="plus" @click="showModal = true">新增</Button>
            </div>
            <Table :columns="askingTableColumns" :loading="pageLoading" ref="askingTable" border :data="askingList"></Table>
            <div class="page-ctrl"  v-if="pageCount">
                <Page :total="pageCount" :current="pageNum" show-total show-elevator @on-change="changePage" :page-size="20">
                </Page>
            </div>
        </Card>
        <Modal :mask-closable="false" v-model="showModal" :title="selectOrder ? '编辑':'新增'" :loading="modalLoading" class-name="asking-modal" @on-ok="clickOK()">
            <header-img-uploader :img-upload-path="postUrl.uploadAskingImgUrl" :upload-img-data="uploadImgData" @on-upload-success="uploadImgSuccess" :show-img-path="uploadImgCallbackPath" class="auto-size-img-upload" icon="image">
            </header-img-uploader>
            <Row>
                <Col span="24" class="title">问题内容</Col>
                <Col span="24">
                    <p>
                        {{selectOrder && selectOrder.question_content}}
                    </p>
                </Col>
                <Col span="24">
                    <Row>
                        <Col span="12" style="padding-left:0;">
                            置顶展示<i-switch v-model="isShow"></i-switch>
                        </Col>
                        <Col span="12" style="padding-left:0;">
                            总价值：<span style="font-weight:bold;font-size:18px;">{{selectOrder.award_money ? '￥'+selectOrder.award_money : selectOrder.love_beans_num + '爱豆' }} </span>
                        </Col>
                    </Row>
                </Col>
            </Row>
        </Modal>
    </div>
</template>

<script src='./asking-order.js'>

</script>

<style lang="scss" src="./asking-order.scss">
</style>
